<%--
    fileName      : addfileflag.jsp
    author        : linyb
    createDate    : 2016-03-14     
    description   : 上传附件结果
--%>

<%@ page language='java' contentType='text/html; charset=UTF-8' pageEncoding='UTF-8' %>
<%@ taglib uri='ctp-tag' prefix='ctp' %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
        <title></title>
        <ctp:include items='public,validator,gridlayout,button,form,label'/>
        <script type='text/javascript' kind='variant'>

            var gridlayout1;
            var label2;
            var form1;
            var fileid_new='<ctp:out name="fileId"/>';
            var ret_code=0;
        </script>
        <script type='text/javascript' kind='event'>
        function initUI(){
            if(''==fileid_new || 'undefined'==fileid_new){
                label2.setText('<ctp:label key="file.upload.fail"/>');//文档上传失败！
                ret_code=-1;
                return ;
            }
        }

		function uploadOk(){
			var ret = {"fileId":fileid_new,"ret_code":ret_code};
			parent.ctpMSB.doHandler(ret, true);
		}
        </script>
        <script type='text/javascript' kind='ui'>

            $(window).load(function(){

                label2 = new ctp.ui.label({
                    id: 'label2',
                    width: '100%',
                    textAlign: 'center',
                    text: '<ctp:label key="file.upload.success"/>'//'上传成功。'
                });

                gridlayout1 = new ctp.ui.gridlayout({
                    id: 'gridlayout1',
                    cols: 1,
                    align:'center',
                    items:[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                    	[{align:'center',element:label2}
                    ]]
                });

                form1 = new ctp.form({                                 
	                id: 'form1',                       
	                items: [gridlayout1],	               
		            buttons: [{                           
		            	id: 'subButton',              
		                text: '<ctp:label key="confirm"/>',//'确定',                  
		                icon:'apply',                
		                onClick: uploadOk     
		            }],
		            renderTo: 'body'                                   
		        });
		        
		        initUI();

            });

        </script>
    </head>
    <body>
		<ctp:form name="form1" method="post" action="" flowActionName="">
        </ctp:form>
    </body>
</html>
